package com.big_data_studio.controller.redis_controller;

import com.big_data_studio.dto.RedisParm;
import com.big_data_studio.util.general.R;
import com.big_data_studio.util.general.RedisUtil;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

/**
 * @author xiao_jie
 * @date 2022/10/15 20:07
 * @describe this is a text
 */

@RestController
@RequestMapping("/redis")
public class RedisController {

    @Resource
    private RedisUtil redisUtil;


    /**
     *  查询redis对应的key的value
     * @param redisParm
     * @return
     */
    @PostMapping("getOne")
    public R getStar(@RequestBody RedisParm redisParm){
        Object hget = redisUtil.hget(redisParm.getRedisKeyName(), redisParm.getId().toString());
        return R.ok(hget,"redis查询成功");
    }



}
